package com.boot2.core.dao.mybatis;

import com.boot2.core.dao.SnowflakeGenerator;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

/**
 * @author zhangweilin
 * @date 2018/7/4 17:08
 * @description:所有mybatis po父类
 */
@MappedSuperclass
public class MyBatisStringSupportEntity extends MyBatisSupportEntity {

    /**
     * 主键
     */
    @ApiModelProperty(value = "主键id")
    @Id
    @GenericGenerator(name="snowflake",strategy = SnowflakeGenerator.TYPE)
    @GeneratedValue(generator = "snowflake")
    @Pk
//    @GeneratedValue(strategy = GenerationType.IDENTITY)
    protected String id;

    public MyBatisStringSupportEntity() {
    }

    public MyBatisStringSupportEntity(boolean isInit) {
        super(isInit);
    }
}
